//
//  gambleAppDelegate.m
//  gamble
//
//  Created by tian on 09-4-8.
//  Copyright __MyCompanyName__ 2009. All rights reserved.
//

#import "gambleAppDelegate.h"

@implementation gambleAppDelegate

@synthesize window;
@synthesize loginView;
@synthesize testViewController;
@synthesize	userName;
@synthesize passward;
@synthesize loginingView;
@synthesize loginingIndicator;


- (void)applicationDidFinishLaunching:(UIApplication *)application {    

    // Override point for customization after application launch
	//[window addSubview:[loginView view]];
	//UIViewController* login = [[UIViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
	//[window addSubview:[login view]];
	//[login release];
	//[window addSubview:[testViewController view]];
	[window addSubview:[loginView view]];
    [window makeKeyAndVisible];
}

-(IBAction)test:(id)sender
{
	NSLog(@"delegate test");
}


- (void)dealloc {
    [window release];
    [super dealloc];
}

#pragma mark -
#pragma mark realcode

-(IBAction)passwardFinished:(id)sender
{
	if(!userName.text || ![userName.text length] || !passward.text || ![passward.text length]){
		UIAlertView* _alertView = [[UIAlertView alloc] initWithTitle:@"用户名密码不能为空" message:nil delegate:nil cancelButtonTitle:@"好得" otherButtonTitles:nil];
		[_alertView show];
		[_alertView release];
		return;
	}
	else {
		[[loginView view] removeFromSuperview];
		[window addSubview:[loginingView view]];
		[loginingIndicator startAnimating];
	}

	
}

@end
